﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace BigData.DataContracts.Objects.BigData
{
    /// <summary>
    /// Represents the relationship between a collection and a database object.
    /// </summary>
    public class RegisteredCollection : BigData.BaseTypes.BigDataDBObject_FiniteLife
    {
        /// <summary>
        /// The Type name of the object which is associated to the associated collection
        /// </summary>
        public string ObjectTypeName { get; set; }
        /// <summary>
        /// The name of the collection which is associated with the associated Type
        /// </summary>
        public string CollectionName { get; set; }
        /// <summary>
        /// A foreign key reference to the data provider from which the object type has come from
        /// </summary>
        public ObjectId DataProvider { get; set; }
        /// <summary>
        /// Represents the last time that the objects in this collection were processed into events
        /// </summary>
        [BsonDateTimeOptions(Kind = DateTimeKind.Utc)]
        public DateTime LastEventSync { get; set; }
    }
}
